

cc.Class({
    extends: cc.Component,

    properties: {
        progress: cc.ProgressBar,
        num: cc.Label,
    },

    //跳转页面
    loadScene() {
        cc.director.loadScene("MapSelect");
    },
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {
        console.log(this.progress);
        this.progress.progress = 0;
        console.log(this.num);
        this.num.string = "0%";
    },

    update(dt) {
        this.progress.progress += 0.01;
        if (this.progress.progress > 1) {
            this.progress.progress = 1;
            this.loadScene();
        }
        this.num.string = Math.floor(this.progress.progress * 100) + "%";
    },
});
